<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div class="div1" id="divID1">1</div>
    <div class="div2">2</div>
    <div class="div3">3</div>
    <script>
      let div = document.getElementsByTagName('div')
      // HTMLCollection文档(https://developer.mozilla.org/zh-CN/docs/Web/API/HTMLCollection)
      console.log(div)
      // 根据ID获取元素
      console.log('namedItem', div.namedItem('divID1'))

      let arr2 = Array.prototype.slice.call(div)
      console.log(arr2)
    </script>
  </body>
</html>
l
